﻿<div class="col-md-6 col-md-offset-3">
    <h2>后台管理</h2>
    <div ng-show=" error" class="alert alert-danger">{{ error}}</div>
    <form name="form" ng-submit="login()" role="form">
        <div class="form-group" ng-class="{ 'has-error': form.username.$dirty && form.username.$error.required }">
            <label for="username">账号</label>
            <input type="text" name="username" id="username" class="form-control" ng-model="account" required />
            <span ng-show="form.username.$dirty && form.username.$error.required" class="help-block">Username is required</span>
        </div>
        <div class="form-group" ng-class="{ 'has-error': form.password.$dirty && form.password.$error.required }">
            <label for="password">密码</label>
            <input type="password" name="password" id="password" class="form-control" ng-model="password" required />
            <span ng-show="form.password.$dirty && form.password.$error.required" class="help-block">Password is required</span>
        </div>

        <div class="form-group">
            <label>记住我</label>
            <input class="form-control" type="checkbox" ng-model="rememberMe"
                   ng-true-value="1" ng-false-value="0"/>
        </div>


        <div class="form-actions">
            <button type="submit" ng-disabled="form.$invalid ||  dataLoading" class="btn btn-primary">Login</button>
            <img ng-if=" dataLoading" src="" />
        </div>
    </form>

    <div>
        <a ui-sref="resetPassword" class="btn btn-link">忘记密码</a>
    </div>
</div>